<template>
  <h1>El-单选组件</h1>
  <el-radio-group v-model="edu">
    <el-radio value="初中" label="学历:初中"></el-radio>
    <el-radio value="高中" label="学历:高中"></el-radio>
    <el-radio value="本科" label="学历:本科"></el-radio>
    <el-radio value="硕士" label="学历:硕士"></el-radio>
  </el-radio-group>

  <h4>您选择的学历是:{{edu}}</h4>

  <!--酒-->
  <el-radio-group v-model="pr">
    <el-radio-button v-for="p in arr" :value="p.price" :label="p.title"></el-radio-button>
  </el-radio-group>
  <h4>您选择的价格是:{{pr}}</h4>
</template>

<script setup>
  import {ref} from "vue";
  const edu = ref('');

  //准备数据
  const arr = ref([
    {title: '五粮液', price: 1000},
    {title: '茅台', price: 1001},
    {title: '梦之蓝', price: 1002},
    {title: '汾酒', price: 55},
  ]);

  const pr = ref('500');
</script>

<style scoped>

</style>